3.134 \(\int \tanh ^4(c+d x) (a+b \tanh ^2(c+d x)) \, dx\)

Optimal. Leaf size=54 \[ -\frac{(a+b) \tanh ^3(c+d x)}{3 d}-\frac{(a+b) \tanh (c+d x)}{d}+x (a+b)-\frac{b \tanh ^5(c+d x)}{5 d} \]

[Out]

(a + b)*x - ((a + b)*Tanh[c + d*x])/d - ((a + b)*Tanh[c + d*x]^3)/(3*d) - (b*Tanh[c + d*x]^5)/(5*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0519301, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3631, 3473, 8} \[ -\frac{(a+b) \tanh ^3(c+d x)}{3 d}-\frac{(a+b) \tanh (c+d x)}{d}+x (a+b)-\frac{b \tanh ^5(c+d x)}{5 d} \]

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]^4*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a + b)*x - ((a + b)*Tanh[c + d*x])/d - ((a + b)*Tanh[c + d*x]^3)/(3*d) - (b*Tanh[c + d*x]^5)/(5*d)

Rule 3631

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp
[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[A - C, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[
{a, b, e, f, A, C, m}, x] && NeQ[A*b^2 + a^2*C, 0] &&  !LeQ[m, -1]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \tanh ^4(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=-\frac{b \tanh ^5(c+d x)}{5 d}+(a+b) \int \tanh ^4(c+d x) \, dx\\ &=-\frac{(a+b) \tanh ^3(c+d x)}{3 d}-\frac{b \tanh ^5(c+d x)}{5 d}+(a+b) \int \tanh ^2(c+d x) \, dx\\ &=-\frac{(a+b) \tanh (c+d x)}{d}-\frac{(a+b) \tanh ^3(c+d x)}{3 d}-\frac{b \tanh ^5(c+d x)}{5 d}+(a+b) \int 1 \, dx\\ &=(a+b) x-\frac{(a+b) \tanh (c+d x)}{d}-\frac{(a+b) \tanh ^3(c+d x)}{3 d}-\frac{b \tanh ^5(c+d x)}{5 d}\\ \end{align*}

Mathematica [A]  time = 0.0340293, size = 97, normalized size = 1.8 \[ -\frac{a \tanh ^3(c+d x)}{3 d}+\frac{a \tanh ^{-1}(\tanh (c+d x))}{d}-\frac{a \tanh (c+d x)}{d}-\frac{b \tanh ^5(c+d x)}{5 d}-\frac{b \tanh ^3(c+d x)}{3 d}+\frac{b \tanh ^{-1}(\tanh (c+d x))}{d}-\frac{b \tanh (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c + d*x]^4*(a + b*Tanh[c + d*x]^2),x]

[Out]

(a*ArcTanh[Tanh[c + d*x]])/d + (b*ArcTanh[Tanh[c + d*x]])/d - (a*Tanh[c + d*x])/d - (b*Tanh[c + d*x])/d - (a*T
anh[c + d*x]^3)/(3*d) - (b*Tanh[c + d*x]^3)/(3*d) - (b*Tanh[c + d*x]^5)/(5*d)

________________________________________________________________________________________

Maple [B]  time = 0.006, size = 128, normalized size = 2.4 \begin{align*} -{\frac{b \left ( \tanh \left ( dx+c \right ) \right ) ^{5}}{5\,d}}-{\frac{a \left ( \tanh \left ( dx+c \right ) \right ) ^{3}}{3\,d}}-{\frac{b \left ( \tanh \left ( dx+c \right ) \right ) ^{3}}{3\,d}}-{\frac{a\tanh \left ( dx+c \right ) }{d}}-{\frac{b\tanh \left ( dx+c \right ) }{d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) a}{2\,d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) b}{2\,d}}+{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) a}{2\,d}}+{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) b}{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x)

[Out]

-1/5*b*tanh(d*x+c)^5/d-1/3/d*a*tanh(d*x+c)^3-1/3*b*tanh(d*x+c)^3/d-a*tanh(d*x+c)/d-b*tanh(d*x+c)/d-1/2/d*ln(ta
nh(d*x+c)-1)*a-1/2/d*ln(tanh(d*x+c)-1)*b+1/2/d*ln(tanh(d*x+c)+1)*a+1/2/d*ln(tanh(d*x+c)+1)*b

________________________________________________________________________________________

Maxima [B]  time = 1.03624, size = 269, normalized size = 4.98 \begin{align*} \frac{1}{15} \, b{\left (15 \, x + \frac{15 \, c}{d} - \frac{2 \,{\left (70 \, e^{\left (-2 \, d x - 2 \, c\right )} + 140 \, e^{\left (-4 \, d x - 4 \, c\right )} + 90 \, e^{\left (-6 \, d x - 6 \, c\right )} + 45 \, e^{\left (-8 \, d x - 8 \, c\right )} + 23\right )}}{d{\left (5 \, e^{\left (-2 \, d x - 2 \, c\right )} + 10 \, e^{\left (-4 \, d x - 4 \, c\right )} + 10 \, e^{\left (-6 \, d x - 6 \, c\right )} + 5 \, e^{\left (-8 \, d x - 8 \, c\right )} + e^{\left (-10 \, d x - 10 \, c\right )} + 1\right )}}\right )} + \frac{1}{3} \, a{\left (3 \, x + \frac{3 \, c}{d} - \frac{4 \,{\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + 2\right )}}{d{\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

1/15*b*(15*x + 15*c/d - 2*(70*e^(-2*d*x - 2*c) + 140*e^(-4*d*x - 4*c) + 90*e^(-6*d*x - 6*c) + 45*e^(-8*d*x - 8
*c) + 23)/(d*(5*e^(-2*d*x - 2*c) + 10*e^(-4*d*x - 4*c) + 10*e^(-6*d*x - 6*c) + 5*e^(-8*d*x - 8*c) + e^(-10*d*x
 - 10*c) + 1))) + 1/3*a*(3*x + 3*c/d - 4*(3*e^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + 2)/(d*(3*e^(-2*d*x - 2*c)
+ 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1)))

________________________________________________________________________________________

Fricas [B]  time = 1.95337, size = 938, normalized size = 17.37 \begin{align*} \frac{{\left (15 \,{\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{5} + 5 \,{\left (15 \,{\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{4} -{\left (20 \, a + 23 \, b\right )} \sinh \left (d x + c\right )^{5} + 5 \,{\left (15 \,{\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{3} - 5 \,{\left (2 \,{\left (20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{2} + 8 \, a + 5 \, b\right )} \sinh \left (d x + c\right )^{3} + 5 \,{\left (2 \,{\left (15 \,{\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{3} + 3 \,{\left (15 \,{\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{2} + 10 \,{\left (15 \,{\left (a + b\right )} d x + 20 \, a + 23 \, b\right )} \cosh \left (d x + c\right ) - 5 \,{\left ({\left (20 \, a + 23 \, b\right )} \cosh \left (d x + c\right )^{4} + 3 \,{\left (8 \, a + 5 \, b\right )} \cosh \left (d x + c\right )^{2} + 4 \, a + 10 \, b\right )} \sinh \left (d x + c\right )}{15 \,{\left (d \cosh \left (d x + c\right )^{5} + 5 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{4} + 5 \, d \cosh \left (d x + c\right )^{3} + 5 \,{\left (2 \, d \cosh \left (d x + c\right )^{3} + 3 \, d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )^{2} + 10 \, d \cosh \left (d x + c\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

1/15*((15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)^5 + 5*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)*sinh(d*x
 + c)^4 - (20*a + 23*b)*sinh(d*x + c)^5 + 5*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)^3 - 5*(2*(20*a + 23*b
)*cosh(d*x + c)^2 + 8*a + 5*b)*sinh(d*x + c)^3 + 5*(2*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c)^3 + 3*(15*(
a + b)*d*x + 20*a + 23*b)*cosh(d*x + c))*sinh(d*x + c)^2 + 10*(15*(a + b)*d*x + 20*a + 23*b)*cosh(d*x + c) - 5
*((20*a + 23*b)*cosh(d*x + c)^4 + 3*(8*a + 5*b)*cosh(d*x + c)^2 + 4*a + 10*b)*sinh(d*x + c))/(d*cosh(d*x + c)^
5 + 5*d*cosh(d*x + c)*sinh(d*x + c)^4 + 5*d*cosh(d*x + c)^3 + 5*(2*d*cosh(d*x + c)^3 + 3*d*cosh(d*x + c))*sinh
(d*x + c)^2 + 10*d*cosh(d*x + c))

________________________________________________________________________________________

Sympy [A]  time = 0.932585, size = 82, normalized size = 1.52 \begin{align*} \begin{cases} a x - \frac{a \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac{a \tanh{\left (c + d x \right )}}{d} + b x - \frac{b \tanh ^{5}{\left (c + d x \right )}}{5 d} - \frac{b \tanh ^{3}{\left (c + d x \right )}}{3 d} - \frac{b \tanh{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right ) \tanh ^{4}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)**4*(a+b*tanh(d*x+c)**2),x)

[Out]

Piecewise((a*x - a*tanh(c + d*x)**3/(3*d) - a*tanh(c + d*x)/d + b*x - b*tanh(c + d*x)**5/(5*d) - b*tanh(c + d*
x)**3/(3*d) - b*tanh(c + d*x)/d, Ne(d, 0)), (x*(a + b*tanh(c)**2)*tanh(c)**4, True))

________________________________________________________________________________________

Giac [B]  time = 1.19379, size = 181, normalized size = 3.35 \begin{align*} \frac{{\left (d x + c\right )}{\left (a + b\right )}}{d} + \frac{2 \,{\left (30 \, a e^{\left (8 \, d x + 8 \, c\right )} + 45 \, b e^{\left (8 \, d x + 8 \, c\right )} + 90 \, a e^{\left (6 \, d x + 6 \, c\right )} + 90 \, b e^{\left (6 \, d x + 6 \, c\right )} + 110 \, a e^{\left (4 \, d x + 4 \, c\right )} + 140 \, b e^{\left (4 \, d x + 4 \, c\right )} + 70 \, a e^{\left (2 \, d x + 2 \, c\right )} + 70 \, b e^{\left (2 \, d x + 2 \, c\right )} + 20 \, a + 23 \, b\right )}}{15 \, d{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{5}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^4*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

(d*x + c)*(a + b)/d + 2/15*(30*a*e^(8*d*x + 8*c) + 45*b*e^(8*d*x + 8*c) + 90*a*e^(6*d*x + 6*c) + 90*b*e^(6*d*x
 + 6*c) + 110*a*e^(4*d*x + 4*c) + 140*b*e^(4*d*x + 4*c) + 70*a*e^(2*d*x + 2*c) + 70*b*e^(2*d*x + 2*c) + 20*a +
 23*b)/(d*(e^(2*d*x + 2*c) + 1)^5)